package org.omg.IOP;

/**
 * Generated from IDL definition of alias "MultipleComponentProfile"
 * 
 * @author IDL compiler
 */

public class MultipleComponentProfileHelper {
	private static org.omg.CORBA.TypeCode _type = org.omg.CORBA.ORB
			.init()
			.create_alias_tc(
					org.omg.IOP.MultipleComponentProfileHelper.id(),
					"MultipleComponentProfile",
					org.omg.CORBA.ORB
							.init()
							.create_sequence_tc(
									0,
									org.omg.CORBA.ORB
											.init()
											.create_struct_tc(
													org.omg.IOP.TaggedComponentHelper
															.id(),
													"TaggedComponent",
													new org.omg.CORBA.StructMember[] {
															new org.omg.CORBA.StructMember(
																	"tag",
																	org.omg.CORBA.ORB
																			.init()
																			.create_alias_tc(
																					org.omg.IOP.ComponentIdHelper
																							.id(),
																					"ComponentId",
																					org.omg.CORBA.ORB
																							.init()
																							.get_primitive_tc(
																									org.omg.CORBA.TCKind
																											.from_int(5))),
																	null),
															new org.omg.CORBA.StructMember(
																	"component_data",
																	org.omg.CORBA.ORB
																			.init()
																			.create_sequence_tc(
																					0,
																					org.omg.CORBA.ORB
																							.init()
																							.get_primitive_tc(
																									org.omg.CORBA.TCKind
																											.from_int(10))),
																	null) })));

	public MultipleComponentProfileHelper() {
	}

	public static void insert(org.omg.CORBA.Any any,
			org.omg.IOP.TaggedComponent[] s) {
		any.type(type());
		write(any.create_output_stream(), s);
	}

	public static org.omg.IOP.TaggedComponent[] extract(org.omg.CORBA.Any any) {
		return read(any.create_input_stream());
	}

	public static org.omg.CORBA.TypeCode type() {
		return _type;
	}

	public static String id() {
		return "IDL:omg.org/IOP/MultipleComponentProfile:1.0";
	}

	public static org.omg.IOP.TaggedComponent[] read(
			org.omg.CORBA.portable.InputStream _in) {
		org.omg.IOP.TaggedComponent[] _result;
		int _l_result3 = _in.read_long();
		_result = new org.omg.IOP.TaggedComponent[_l_result3];
		for (int i = 0; i < _result.length; i++) {
			_result[i] = org.omg.IOP.TaggedComponentHelper.read(_in);
		}

		return _result;
	}

	public static void write(org.omg.CORBA.portable.OutputStream _out,
			org.omg.IOP.TaggedComponent[] _s) {

		_out.write_long(_s.length);
		for (int i = 0; i < _s.length; i++) {
			org.omg.IOP.TaggedComponentHelper.write(_out, _s[i]);
		}

	}
}
